<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="com.dss.service.ExpertConsultationService"%>
<%@page import="com.dss.po.Expert"%>
<%@page import="com.dss.po.ExpertClass"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<%
	com.infomanage.po.User user = (com.infomanage.po.User) request.getSession().getAttribute(com.infomanage.util.Consts.LOGINED_USER);
	HashMap<ExpertClass, List<Expert>> datas = ExpertConsultationService.loadAllExpertsWithClass(request, response, out);
%>  
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>矿山救护远程调度管理指挥系统</title>
	<link href="../../css/style.css" rel="stylesheet" type="text/css">
	<link href="../../css/table.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="../../js/common.js"></script>
	<style type="text/css">
		.left_ercon1_1{margin:0 auto; padding-bottom:5px; padding-top: 5px}
		.er_tit2{height:30px;width:200px; overflow:hidden;}
		.er_tit2 a{background:url(class.png); display:block; height:30px; line-height:30px; width:200px; padding-left:19px; color:#0d348b; font-size:14px; font-weight:bold;}
		.left_ercon1_1 ul{margin:9px auto 0; width:192px; overflow:hidden;}
		.left_ercon1_1 li{float:left; width:80px;height:21px;text-align:left;padding:0px 0px 2px 1px;}
		.left_ercon1_1 li a{color:#333;height:23px; line-height:21px;padding-left:10px; }
		.left_ercon1_1 li a:hover{background:#688fc9; color:#fff; text-decoration:none;}
	</style>
	<script type="text/javascript">
		var curExpertClassId;
		var curExpertId;
		function clickExpert(expertId, aLabel){
			curExpertId = expertId;
			var expertItems = document.getElementsByName("expertItem");
			for(var i = 0; i < expertItems.length; i++){
				var expertItem = expertItems[i];
				expertItem.style.background = '#FFFFFF';
				expertItem.style.color = "#0d348b";
			}
			if(aLabel != null){
				aLabel.style.background = '#688fc9';
				aLabel.style.color = "#fff";
			}
			dataFrm.location.href = "ecs_data.jsp?expertId=" +  expertId + "&searchType=" + '<%=ExpertConsultationService.SEARCH_TYPE_EXPERT%>';
		}
		
		function clickExpertClass(expertClassId, aLabel){
			curExpertClassId = expertClassId;
			var expertClassItems = document.getElementsByName("expertClassItem");
			for(var i = 0; i < expertClassItems.length; i++){
				var classItem = expertClassItems[i];
				classItem.style.backgroundImage = 'url(class.png)';
				classItem.style.color = "#0d348b";
			}
			if(aLabel != null){
				aLabel.style.backgroundImage = 'url(class_blue.png)';
				aLabel.style.color = "#fff";
			}
			dataFrm.location.href = "ecs_data.jsp?expertClassId=" +  expertClassId + "&searchType=" + '<%=ExpertConsultationService.SEARCH_TYPE_EXPERTCLASS%>';
		}

		function search(){
			var keyword = document.getElementById("keyword").value;
			dataFrm.location.href = "ecs_data.jsp?keyword=" +  keyword + "&searchType=" + '<%=ExpertConsultationService.SEARCH_TYPE_KEYWORD%>';
		}

		function showExpertInfo(expertId){
			var url = "expert_info_view.jsp?expertId=" + expertId;
			var width = '450px';
			var height ='450px';
			var arg = "dialogHeight:" + height + ";dialogWidth:" + width + ";status:no;location:no;";
			var returnValue = window.showModalDialog(url, "", arg);
			if(returnValue){
				window.location.reload();
			}
	    }
	</script>
<body rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onclick="clickBody();" style="background: #ffffff;">
<form name="searchForm" id="searchForm" action="equmgmt_data.jsp" target="dataFrame" method="post">
<table width="100%" height="100%"   border="0"  align="center" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
	<!-- 位置导航栏 -->
	<tr height="25px">
		<td width="100%" align="center" valign="top">
			 <table width="98%" border="0" cellpadding="0" cellspacing="0" class="tabtitle">
              <tr>
                <td width="4%" valign="top"><img src="../../img/pic_dot1.gif" width="37" height="22"></td>
                <td width="96%" valign="middle">当前位置：<a  class="n">救援决策支持</a> &gt;&gt; <a  class="n">专家咨询</a></td>
              </tr>
            </table>
		</td>
	</tr>
   
   <!-- 查询工具条 -->
   <tr height="29px">
	   <td valign="top">
	   		<table width="98%" height="29" cellpadding="0" cellspacing="0" align="center" border="0">
	   			<tr height="100%">
		   		
		   			<td class="td_title" width="400" align="left">
		   				<table cellpadding="0" cellspacing="0" border="0">
		   					<tr>
		   						<td align="center" width="100px">关键字检索</td>
		   						<td>
									<input name="keyword" value="" type="text" style="width:300px">
		   						</td>
		   					</tr>
		   				</table>
		   			</td>
		   			<td class="td_title" style="border-right: 1px #a3c6e2 solid;border-left: none;padding-left:20px;">
							<input name="Button12" type="button" class="button_cx" value="" title="查询" onclick="search();">
					</td>
	   			</tr>
	   		</table>
	   </td>
   </tr>
   
   <!-- 空格 -->
   <tr height="3px">
		<td>
			&nbsp;
		</td>
   </tr>
   
   <tr >
   	 <td>
   	 	 <table  width="98%" height="100%"   cellpadding="0" cellspacing="0"  align="center" style="table-layout: fixed;background: #ffffff;border: 1px #a8cae3 solid" >
   	 	    <col width="22%">
   	 	    <col width="78%">
   	 	 	<tr>
   	 	 		<td valign="top" align="center">
   	 	 		<%
   	 	 			for(Entry<ExpertClass, List<Expert>> entry : datas.entrySet()){
	   	 	 			ExpertClass expertClass = entry.getKey();
	   	 	 		    List<Expert> experts = entry.getValue();
	   	 	 	%>
	   	 	 		<div class="left_ercon1">
	   	 	 			<div class="left_ercon1_1">
	   	 	 				<div class='er_tit2'><A name="expertClassItem" href='#' onclick="clickExpertClass('<%=expertClass.getExpertClassId() %>', this);"><%=expertClass.getTitle() %></A></div>
		   	 	 			<UL style='display: block;'>
		   	 	 				<%
		   	 	 					if(experts != null){
		   	 	 						for(Expert expert : experts){
		   	 	 				%>
									<LI><img src="../../img/expert.gif" style="cursor: hand" onclick="javascript:showExpertInfo('<%=expert.getExpertId() %>');"/><A name="expertItem" href='#' onclick="clickExpert('<%=expert.getExpertId() %>', this);"><%=expert.getName() %></A></li>
		   	 	 				<%
		   	 	 						}
		   	 	 					}
		   	 	 				%>
							</UL>
						</div>
					</div>
	   	 	 	<%
   	 	 			}
   	 	 		%>
   	 	 		</td>
   	 	 		<td>
					<iframe name="dataFrm" src="ecs_data.jsp" frameborder="0" width="100%" height="100%" ></iframe>   	 	 			
   	 	 		</td>
   	 	 	</tr>
   	 	 </table>
   	 </td>
   </tr>
   
   <!-- 数据列表 -->
   <tr>
	<td align="center">
		<iframe src=""  name="dataFrame" frameborder="0" width="98%" height="100%" scrolling="no"></iframe>
	</td>
   </tr>
</table>
</form>
</body>
</html>
